<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<div class="page-header" style="border-bottom: none">
    <h1 class="text-success"><img src="http://bigd.big.ac.cn/static/image/biocode.png" height="70px" width="70px"/>
        BioCode&nbsp;
        <small>Archive Bioinformatics Codes for Open Source Projects</small>
        <br>
    </h1>
</div>
<nav class="navbar navbar-default " id="header-nav">
    <div class="navbar-header">
        <button type="button" class="navbar-toggle collapsed" data-target="#db" data-toggle="collapse"
                aria-expanded="false">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </button>

        <a href="${host}/" class="navbar-brand"><i class="fa fa-home">Home</i></a>
    </div>
    <div class="collapse navbar-collapse" id="db">
        <ul class="nav navbar-nav">
            <li><a href="${host}/categories"><i class="fa fa-navicon"></i> Categories</a></li>
            <li><a href="${host}/tools/search"><i class="fa fa-search"></i> Search</a></li>
            <%--<li><a href="${host}/search">Search</a></li>--%>
            <li><a href="${host}/stats"><i class="fa fa-line-chart"></i> Statistics</a></li>

            <%--<li><a href="${host}/help">Help</a></li>--%>
        </ul>
        <ul class="nav navbar-nav navbar-right">
            <c:if test="${currentUser == null}">
                <li><a href="${host}/login">
                    <i class="fa  fa-sign-in fa-fw"></i>
                    Sign in
                </a></li>
                <li><a href="http://sso.big.ac.cn/cas/register/register.jsp?service=${host}/login/cas">
                    <i class="fa fa-user-plus"></i>
                    Sign Up
                </a></li>
            </c:if>
            <c:if test="${currentUser != null}">
                <%--<li><a href="${host}/curator/home">My account</a></li>--%>
                <li><a href="${host}/tools/new"><i class="fa fa-upload"></i> Submit Tool</a></li>

                <li class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                        <i class="fa fa-user fa-fw"></i>${currentUser.username} <i class="fa fa-caret-down"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-user">
                <c:if test="${fn:contains(currentUser.roleList,'ADMIN')}">
                        <li>
                            <a href="${host}/admin/tools/list"><i class="fa fa-cogs fa-fw"></i> Admin</a>
                        </li>
                </c:if>
                        <li>
                            <a href="${host}/user/tools"><i class="fa fa-cogs fa-fw"></i> Submitted Tools</a>
                        </li>
                        <li>
                            <a href="${host}/users/${currentUser.id}" target="_blank"><i
                                    class="fa fa-user fa-fw"></i> Personal Portal</a>
                        </li>
                        <%--<li class="divider"></li>--%>
                        <li><a id="logout" href="${host}/logout"><i class="fa fa-sign-out fa-fw"></i> Logout</a></li>
                    </ul>
                </li>
                <%--<li><a href="${host}/logout"><i class="fa fa-sign-out"></i> Sign out</a></li>--%>
            </c:if>
        </ul>
    </div>
</nav>
<script>
   /* $(document).ready(function () {
        $("#logout").click(function (e) {
            e.preventDefault();
            $("#logoutform").submit();
        });
    });*/
</script>
